<!DOCTYPE html>
<html lang="zh_cn">
<head>
    <script type="text/javascript">
        // console.log("window.top.location.href",window.top.location.href);
        // console.log("location.href=",location.href);
        if (window.top.location.href!==location.href) {
            window.onload=function (){
                document.body.style.display="none";
            };
            window.top.location.href=location.href;
        }else{
            window.onload=function (){
                document.body.style.display="block"
            };
        }
    </script>
    <title>{$system['name']}后台登录</title>
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <style type="text/css">
        html,body{width: 100%;min-height: 100%;}
        body{background: url(/static/img/loginbg.png) 0% 0% / cover no-repeat;}
        @keyframes rotate{0%{transform:perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(0)}100%{transform:perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(-360deg)}}
        #particles-js {position: absolute;width: 100%;height: 100%;}
        .login-box{padding:15px 30px;border:1px solid #aaa;border-radius:5px;background-color:rgba(255,255,255, 0.2);width:260px;position:fixed;left:50%;top:50%;z-index:999;margin:-200px 0 0 -160px;}
        .layui-form-pane .layui-form-label{width:50px;background-color:rgba(255,255,255, 0.5);color:#fff;}
        .layui-form-pane .layui-input-block{margin-left:50px;}
        .login-box .layui-input{font-size:18px;font-weight:400;background-color:rgba(255,255,255, 0.5);color:#fff;display:inline-block;}
        .login-box input[name="password"]{letter-spacing:5px;font-weight:800}
        .login-box input[type="submit"]{letter-spacing:5px;}
        .login-box input[name="captcha"]{width:75px;}
        .captcha{float:right;border-radius:3px;width:120px;height:38px;overflow:hidden;}
        .login-box .layui-btn{width:100%;}
        .login-box .copyright{text-align:center;height:50px;line-height:50px;font-size:12px;color:#fff}
        .login-box .copyright a{color:#fff;}
        @media only screen and (min-width:750px){
            .login-box{width:350px;margin:-200px 0 0 -205px!important}
            .login-box input[name="captcha"]{width:165px;}
        }
    </style>
</head>
<body style="display: none;">
<div id="particles-js">
    <div class="login-box">
        <form method="post" class="layui-form layui-form-pane">
            <fieldset class="layui-elem-field layui-field-title">
                <legend style="color:#fff;">    管理后台登录</legend>
            </fieldset>
            <div class="layui-form-item">
                <label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
                <div class="layui-input-block">
                    <input type="text" name="username" class="layui-input" lay-verify="required" placeholder="登录账号" autofocus="autofocus" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
                <div class="layui-input-block">
                    <input type="password" name="password" class="layui-input" lay-verify="required" placeholder="登录密码" />
                </div>
            </div>
            {if $system['code'] == 'open'}
            <div class="layui-form-item">
                <label class="layui-form-label"><i class="layui-icon layui-icon-vercode"></i></label>
                <div class="layui-input-block">
                    <input type="text" name="vercode" class="layui-input" placeholder="验证码" autocomplete="off" /><img  height="38" width="120" style="position: absolute;top:0;right: 0;cursor: pointer;" id="captchaImg"  src="{:url('verify')}" alt="captcha" onclick="this.src=this.src+'?id='+Math.random()" class="captcha" />
                </div>
            </div>
            {/if}
                     <input type="submit" value="登录" lay-submit lay-filter="login" class="layui-btn layui-btn-normal">
        </form>
        <div class="copyright">
            {$system['name']} © {:config('app.url_domain_root')}
        </div>
    </div>
</div>
<script type="text/javascript" src="/static/layuimini/lib/layui-v2.6.3/layui.js"></script>
<script src="/static/js/particles.min.js"></script>
<script type="text/javascript">

        layui.use('form',function(){
        var form = layui.form,$ = layui.jquery;
        //监听提交
        form.on('submit(login)', function(data){
        loading =layer.load(1, {shade: [0.1,'#fff'] });//0.1透明度的白色背景
        $.post('{:url("login/index")}',data.field,function(res){
        layer.close(loading);
        if(res.code == 1){
        layer.msg(res.msg, {icon: 1, time: 1000}, function(){
            location.href = "{:url('admin/index/index')}";
          /*  if(res.url){
                location.href=res.url;
            }else{

            }*/
    });
    }else{
        $('input[name="vercode"]').val('');
        layer.msg(res.msg, {icon: 2, anim: 6, time: 1000});
        $('#captchaImg').click();
    }
    });
        return false;
    });
    });

    particlesJS("particles-js",{"particles":{"number":{"value":50,"density":{"enable":true,"value_area":800}},"color":{"value":"#ffffff"},"opacity":{"value":0.2,"random":false,"anim":{"enable":false,"speed":1,"opacity_min":0.1,"sync":false}},"size":{"value":3,"random":true,"anim":{"enable":false,"speed":40,"size_min":0.1,"sync":false}},"line_linked":{"enable":true,"distance":150,"color":"#ffffff","opacity":0.4,"width":1},"move":{"enable":true,"speed":6,"direction":"none","random":false,"straight":false,"out_mode":"out","bounce":false,"attract":{"enable":false,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"canvas","events":{"onhover":{"enable":true,"mode":"grab"},"onclick":{"enable":true,"mode":"push"},"resize":true},"modes":{"grab":{"distance":140,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"duration":0.4},"push":{"particles_nb":4},"remove":{"particles_nb":2}}},"retina_detect":true});
</script>
</body>
</html>